// TOWN SCRIPT
//    Town 0: Huts

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

int i,j,k,r1,choice;
short donnaud_ask = 1;

body;

beginstate INIT_STATE;
	//Names must appear first.

// Regenerate NPCs
// Klinger ID = 101
// Valzier ID = 300
spawn_creature(6);
spawn_creature(7);
if (get_sdf(110,0) == 10) {
 add_char_to_party(6);
 set_flag(110,0,1);
 print_str_color("Klinger is able to rest and rejoins the party!",3);
}
if (get_sdf(110,1) == 10) {
 add_char_to_party(7);
 set_flag(110,1,1);
 print_str_color("Valzier is able to rest and rejoins the party!",3);
}
erase_char(6);
erase_char(7);
				
	set_crime_tolerance(5);

break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;
// This state is called every turn the party is in this town.

break;

beginstate 10;

if (get_sdf(0,1) == 0) {
 set_flag(0,1,1);
 message_dialog("You leave the hut in the morning and look around. The ruined huts are still quite empty and utterly silent. No sign of any intelligent life, just the chirping of birds and the sounds of wildlife.","These huts do not look too old, perhaps a few years at most. You wonder what happened to the former residents of this place.");
}

break;

beginstate 11;

block_entry(1);
message_dialog("You look around and you realize this was the way you entered the village. In fact, you are quite certain of it. Going back this way would probably not be the best advice if you want to find the shore as soon as possible.","You decide to turn back.");

break;

beginstate 12;

if (get_sdf(0,2) == 0) {
 set_flag(0,2,1);
 message_dialog("You find a ruined temple of sorts. The structure is quite crude, but definitely more advanced then the shattered huts. However, it is still primitive and unimpressive.","You look around and see dried blood and other signs of a struggle. You are willing to bet the mystery of the village had something to do with this past struggle.");
}

break;

beginstate 13;

if (get_sdf(0,3) == 0) {
 set_flag(0,3,1);
 message_dialog("Seems you have solved one part of this mystery. Behind this temple is a hidden area where the now skeletal bodies of many humanoids have been recklessly thrown. Upon closer inspection, the remains are definitely Nephil.","Now you know that many bodies have been placed here, but by whom? You now can guess something violent happened here. But many questions have been created by this new discovery.");
}

break;